package cz.khfotbal.domain;

import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

@Entity
@Table(name = "COMPETION")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class Competion {

	@Id
	@GeneratedValue
	private int id;

	private String name;

	@OneToMany(mappedBy = "competion", cascade = CascadeType.ALL)
	private Set<SeasonCompetion> seasonCompetions;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Set<SeasonCompetion> getSeasonCompetions() {
		return seasonCompetions;
	}

	public void setSeasonCompetions(Set<SeasonCompetion> seasonCompetions) {
		this.seasonCompetions = seasonCompetions;
	}

}
